In recent years, digital imaging technology advances day after day, and various different electronic devices (such as digital cameras, digital camcorders, notebook computers and mobile phones) having digital imaging devices (such as CCD and CMOS) are introduced to the market, not only providing increasingly higher imaging quality and smaller size, but also offering an increasingly lower price, and thus these electronic devices become popular. Although many digital electronic camera devices come with advanced functions including auto focus and auto exposure, the electronic camera devices determine a captured image by a sensed scene according to the information of the captured image, wherein a face only occupies a small portion of the whole scene, and thus it is difficult for a photography novice to capture a satisfactory portrait due to the user's lack of ability and experience of adjusting the shutter and diaphragm correctly. Thus, it is an important subject for manufacturers and designer to develop different electronic camera devices having intelligent functions to meet the consumer requirement of the basic photography, compensate their insufficient photographic techniques, and effectively save the long adjusting time or simplify the procedure to shoot high-quality portraits.
To provide consumers an intelligent imaging function of the electronic camera device to shoot high-quality portraits, some manufacturers have applied a face detection technology to the electronic camera devices, and many face detection algorithms have been disclosed in technical papers and bulletins, and the most popular face detector is based on the Gentle Adaboost (GAB) algorithm, and the face detector uses a Haar-like feature to identify a face, and also uses a specific quantity of face pattern samples to train a required face classifier, and determines whether or not an image of a scene is a face, so that the face in the scene can be detected or identified quickly. In a traditional GAB algorithm, the rules of operation are listed in the table below:
A stage of Haar feature classifier construction using GAB1.Start with weights wi = 1/2p and 1/2l where p and l are the number ofpositive and negative class samples.2.Repeat for m = 1, 2, . . . , M.(a) For each Haar feature j, fm(x) = Pw(y = 1|x) − Pw(y = −1|x)using only the feature j values.(b) Choose the best feature confidence set of values fm(x) givingthe minimum weighted error em = Ew[1(yi≠sign[fm(xi)]] for allfeature j.(c) Update F(x) ← F(x) + fm(x)(d) Set wi ← wi exp[−yi · fm(xi)], i = 1, 2, . . . , N.,and renormalize so that Σwi = 1. 3.      Output    ⁢                  ⁢    the    ⁢                  ⁢    classifier    ⁢                  ⁢          sign      ⁢                          [              F        ⁡                  (          x          )                    ]        =            sign      ⁡              [                              ∑                          m              -              1                        M                    ⁢                                          ⁢                                    f              m                        ⁡                          (              x              )                                      ]              .  
The GAB algorithm selects the best Haar feature of a minimum weighted error em from all features. For each weak classifier fm(x), the GAB algorithm selects a feature j to minimize the error function by Formula (1):
                                          f            m                    ⁡                      (            x            )                          =                                            arg              ⁢                                                          ⁢              min                        j                    ⁢                      {                                          ∑                i                            ⁢                                                          ⁢                                                w                  i                                *                                  v                  i                                                      }                                              (        1        )            where,
      v    i    =      {                                                                      1                ⁢                                                                  ⁢                represents                            -              missclassified                                                                                          0                ⁢                                                                  ⁢                represents                            -              others                                          ,              w        i            is a sample weight.
From the list above and Formula (1), although the GAB algorithm can update each stage classifier in each loop of the iteration by using a confidence-rated real value, the misclassification error defined in the GAB algorithm is discrete. In Formula (1), νi is a Boolean variable, and νi is equal to 1 for a misclassification, and 0 for a classification. Similarly, a weak classifier with a binary output in the discrete Adaboost algorithm does not mean that the Haar-like features are in a good distribution, and thus the misclassification error defined in the aforementioned algorithm cannot describe the distribution of the misclassification errors accurately.
In view of the description above, the inventor of the present invention redefined the misclassification error em of the GAB algorithm in his related patent application as shown in Formula (2) below:
                              e          m                =                                            ∑              i                        ⁢                                                  ⁢                                          w                i                            *                              v                i                                              =                                    ∑              i                        ⁢                                                  ⁢                                          w                i                            *                              (                                                      y                    i                                    -                                                            f                      m                                        ⁡                                          (                                              x                        i                                            )                                                                      )                                                                        (        2        )            
where, νi is the distance between the confidence-rated real value and the expected class label. According to a journal “Face Detection Using Look-up Table Based Gentle Adaboost” authored by Cem Demirkir and Bülent Sankur and published in the Audio- and Video-based Biometric Person Authentication on July, 2005, if fm(xi) varies within the range of [−1,1], νi is a real variable distributed within the range of [−2,2], and the definition uses a confidence form to describe the misclassification error, and uses a histogram bin in the computer programming to compute the misclassification error. For example, two histogram bins as shown in FIG. 1 are provided to show the difference between two types of definitions, wherein positive samples of the histogram bins have different distributions on the features i and j. For simplicity, the positive samples have the same distribution as the negative samples. If Formula (1) is used, the resultant error summations of the two types of feature spaces are the same, but if Formula (2) is used, the resultant error summation of feature j will be smaller than the computed result of the feature I. As to a greedy searching scheme, the feature j will be selected for building a weak classifier. According to the definition of the weak classifier function, if samples in a histogram bin are difficult to be separated, then the output confidence value is close to zero, or else the output confidence value is close to 1 or −1. This result shows that the output confidence value of the feature j is much greater than the output confidence value of the feature i. In the two histogram bins as shown in FIG. 1, the sample in the histogram bin space of the feature j is easier to be separated than the sample in the histogram bin space of the feature i, so that the confidence-rated definition of the misclassification error becomes more reasonable.
Traditionally, a Haar-like feature is defined in a way that, four basic units (as shown in FIG. 2) in a feature pool are provided for detecting a feature prototype of an object in an image window, wherein the prototype 10, 11 represents an edge feature; the prototype 12 represents a line feature; the prototype 13 represents a special diagonal line feature; the black region represents a negative weight; and a white region represents a positive weight. However, the inventor of the present invention attempts to provide separate samples in histogram bins easier based on the definition of the foregoing algorithm by using eight basic units (as shown in FIG. 3) in a feature pool for detecting a feature prototype of an object in an image window when the Haar-like feature is defined, and such feature prototype is called an extended Haar feature. The feature prototype 20, 21 represents an edge feature, wherein the black region represents a negative weight; the white region represents a positive weight; and the black region and the white region are distributed on the same horizontal or vertical line, but a specific distance is maintained between the black and white regions. The feature prototype 22, 23 represents an edge feature, wherein the black region represents a negative weight; the white region represents a positive weight; the black region and the white region are intersected perpendicularly with each other. The feature prototype 24, 25 represents a line feature prototype, wherein the black region represents a negative weight; the white region represents a positive weight; and the black region and the white region are intersected diagonally with each other. The prototype 26, 27 represents a special diagonal line feature, wherein the black region represents a negative weight; the white region represents a positive weight; and ¼ of the area of the black region and the white region is overlapped along their diagonals.
Although the foregoing definition of the extended Haar feature can separate samples in the histogram bin easier, but the inventor of the present invention also takes the following conditions into consideration for detecting and identifying a face in a preview image:
1. To detect a newly present unknown face in a current frame and an unknown face that is not detected in a previous frame, it is necessary to complete a detecting process for the whole image.
2. To complete the detecting process for the whole image, a large computing value slows down the processing speed.
3. Due to the complexity of the photographic environment, non-face patterns can be rejected accurately when the face in an image is detected.
4. When variable factors including pose, expression and illumination are taken into consideration, the known face detected in the previous frame by a face detector cannot be too stringent.
From the description above, Cases 1 and 2 are contradictive to each other. An image of 120×160 pixels is taken for example. Traditionally, ten searching windows of different sizes are provided for a face detector to search for any face in each preview image, and the sizes of the searching windows are searched one by one along the horizontal and vertical directions. The faces are searched by an iteration of moving horizontally and vertically on the whole image, and thus the number of operations in the detecting process is very large, and the speed and efficiency of the face detection become very low. Obviously, the prior art cannot meet the consumer requirements.